package P1300;

import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.Stack;

/**
 * @author: zhouyang
 * @descrpition:
 * @time: 2019-10-12 15:31
 */
public class P1307_数字反转 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        scanner.close();
        boolean flag = input.charAt(0) != '-';
        int index = flag?0:1;
        Queue<Integer> queue = new LinkedList<>();
        while(index < input.length()){
            queue.offer(input.charAt(index)-'0');
            ++index;
        }
        int res = 0;
        while(!queue.isEmpty() && queue.peek() == 0) queue.poll();
        int floor = 1;
        while(!queue.isEmpty()){
            res += floor*queue.poll();
            floor *= 10;
        }
        if(!flag) res *= -1;
        System.out.println(res);
    }
}
